{foreach from=$menus[$menu_key] key=key item=value}
    {if $value.enable == 1}
    <h3 class="f14"><span class="switchs cu on" title="展开与收缩"></span>{$value.title}</h3>
    <ul>
    {foreach from=$value.child key=k item=v}
        {if $v.enable == 1}
            <li id="_MP{$key}_{$k}" class="sub_menu"><a href="javascript:_MP('{$key}_{$k}','{$base_url}{$v.url}');" hidefocus="true" style="outline:none;">{$v.title}</a></li>
        {/if}
    {/foreach}
    </ul>
    {/if}
{/foreach}

<script type="text/javascript">
$(".switchs").each(function(i) {
	var ul = $(this).parent().next();
	$(this).click(
	    function() {
		    if(ul.is(':visible')) 
            {
			    ul.hide();
			    $(this).removeClass('on');
            } else {
			    ul.show();
			    $(this).addClass('on');
            }
        })
});
</script>